<template>
	<view class="warp">
		<u-navbar title="用户注册" :background="background" backIconColor="#fff" titleColor="#fff"></u-navbar>
		<view class="reg_box">
			<view class="h1">欢迎注册</view>
			<view class="span">济态商城欢迎您的注册！</view>
			<u-form :model="model" ref="uForm">
				<u-form-item class="uformitem" left-icon="account" :label-position="labelPosition" label="用户名" prop="username" label-width="170">
					<u-input :border="border" placeholder="请输入用户名" v-model="model.username" type="text"></u-input>
				</u-form-item>
				<u-form-item class="uformitem" left-icon="phone" :label-position="labelPosition" label="手机号码" prop="mobile" label-width="170">
					<u-input :border="border" placeholder="请输入手机号" v-model="model.mobile" type="number"></u-input>
				</u-form-item>
				<u-form-item class="uformitem" left-icon="coupon" :label-position="labelPosition" label="验证码" prop="code" label-width="170">
					<u-input :border="border" placeholder="请输入验证码" v-model="model.code" type="text"></u-input>
					<u-button slot="right" plain shape="circle" size="mini" @click="getCode">{{ifsms.text}}</u-button>
				</u-form-item>
				<u-form-item class="uformitem" left-icon="heart" :label-position="labelPosition" label="邀请码" prop="yaoqing" label-width="170">
					<u-input :border="border" placeholder="请输入邀请码" v-model="model.yaoqing" type="number"></u-input>
					<view class="input_right_btn" slot="right" @click="scanCode">
						<u-icon name="camera" color="#999" size="40"></u-icon>
					</view>
				</u-form-item>
				<u-form-item class="uformitem" left-icon="lock" :label-position="labelPosition" label="登录密码" prop="password" label-width="170">
					<u-input :border="border" placeholder="请输入登录密码" v-model="model.password" type="password"></u-input>
				</u-form-item>
			</u-form>
			<view class="submitBtn">
				<u-button @click="submit" type="success" shape="circle">确认注册</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				background: {
					backgroundImage: 'linear-gradient(45deg, #35c877, rgb(141, 198, 63))'
				},
				model: {
					username: '',
					mobile: '',
					code: '',
					yaoqing: '',
					password: ''
				},
				border: false,
				labelPosition: 'left',
				ifsms: {
					ifbut: true,
					ifnum: 60,
					text: "获取验证码",
					defnum: 60
				}
			}
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">
	.reg_box {
		width: 100%;
		padding: 34rpx 42rpx 0 42rpx;
		
		.h1 {
			font-size: 40rpx;
			font-weight: bold;
			color: #666;
			padding-bottom: 6rpx;
		}
		.span {
			font-size: 28rpx;
			color: #ccc;
			padding-bottom: 30rpx;
		}
		
		.u-form-item {
			padding: 36rpx 0;
		}
	}
</style>
